<?php
	include("$GLOBALS[dir_root]/conf.php");

	class CUser
	{
		// attributi
		var $_logged = false;

		// info
		var $name = "Guest";

		// accesso
		var $id;
		var $usr;
		var $psw;

		// accesso al db
		var $db_usr = "guest";
		var $db_psw = "gue";
		var $db_grp = 4;

		// constructor
		public function __construct()
		{

		}

		// load from current session
		private function _loadSession()
		{
//			$this->name = $_SESSION['usr_logged'];
//			$this->name = $_SESSION['usr_name'];
//			$this->id = $_SESSION['usr_id'];
//			$this->usr = $_SESSION['usr_usr'];
//			$this->psw = $_SESSION['usr_psw'];
//			$this->db_usr = $_SESSION['usr_dbusr'];
//			$this->db_psw = $_SESSION['usr_dbpsw'];
//			$this->db_grp = $_SESSION['usr_dbgrp'];
		}

		// save variables value into the current session
		private function _registerSession()
		{
//			session_register('usr_name', 'usr_id', 'usr_usr', 'usr_psw', 'usr_dbusr', 'usr_dbpsw', 'usr_dbgrp');
//			$_SESSION['usr_name'] = $this->name;
//			$_SESSION['usr_id'] = $this->id;
//			$_SESSION['usr_usr'] = $this->usr;
//			$_SESSION['usr_psw'] = $this->psw;
//			$_SESSION['usr_dbusr'] = $this->db_usr;
//			$_SESSION['usr_dbpsw'] = $this->db_psw;
//			$_SESSION['usr_dbgrp'] = $this->db_grp;
		}

		// clear variables from current session
		private function _unregisterSession()
		{
//			session_unregister('usr_name');
//			session_unregister('usr_id');
//			session_unregister('usr_usr');
//			session_unregister('usr_psw');
//			session_unregister('usr_dbusr');
//			session_unregister('usr_dbpsw');
//			session_unregister('usr_dbgrp');
		}

		private function _print()
		{
			return "{[name:$this->name],[id:$this->id],[usr:$this->usr],".
				"[psw:$this->psw],[psw:$this->db_usr],[psw:$this->db_psw],".
				"[psw:$this->db_grp], }";
		}
	}
?>